#include <myheader_c_plus.h>
using std::endl;
using std::cout;

class Base{
public:

    Base(){}
    Base(int base)
    :_base(base)
    {

    }

    virtual void print(){
        cout << "base" << endl;
    }

    virtual void display(){
        cout << "base display" << endl;
    }
private:
    int _base;
};

class Drived : public Base{
public:
    Drived(){}
    Drived(int base, int drived)
    :Base(base)
    ,_drived(drived)
    {

    }
    
    void print() override{
        cout << "deived" << endl;
    }


    void display() override{
        cout << "dirved display" << endl; 
    }

private:
    int _drived;
};
int main(int argc, char *argv[])
{
    Drived d(1,2);
    Base * pBase = &d;
    pBase->print();
    Drived d2(2,4);
    Drived * pDrived = &d2;
    pDrived->print();
    pBase = &d2;
    pBase->display();
    d.display();


    cout << "sizeof(Base)" << sizeof(Base) << endl;
    cout << "sizeof(Drived)" << sizeof(Drived) << endl;
    
    return 0;
}

